<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('码商配置列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
		<div class="row">
	        <div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="channel:channelSetting:add">
					<i class="fa fa-plus"></i> 添加
				</a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
		var channelId = [[${channelId}]]
        var editFlag = [[${@permission.hasPermi('channel:channelSetting:edit')}]];
        var removeFlag = [[${@permission.hasPermi('channel:channelSetting:remove')}]];
        var prefix = ctx + "channel/channelSetting";

        $(function() {
            var options = {
                url: prefix + "/list/"+channelId,
                createUrl: prefix + "/add/"+channelId,
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export/"+channelId,
                modalName: "码商配置",
		        showExport: true,
                columns: [
				{
					field : 'rateId', 
					title : 'id',
					visible: false
				},
				{
					field : 'payLabel',
					title : '支付类型'
				},
				{
					field : 'depositRate', 
					title : '预充值费率'
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.rateId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-success btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.rateId + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>